```html
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>延时队列技术详解 | 技术小馆</title>
    <link href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
    <link href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            color: #333;
            line-height: 1.8;
        }
        h1, h2, h3, h4 {
            font-family: 'Noto Serif SC', serif;
            font-weight: 600;
        }
        .hero-gradient {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        }
        .card-hover:hover {
            transform: translateY(-5px);
            box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
        }
        .tab-active {
            border-bottom: 3px solid #667eea;
            color: #667eea;
            font-weight: 500;
        }
        .feature-icon {
            width: 60px;
            height: 60px;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        }
        img {
            border-radius: 8px;
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
            transition: all 0.3s ease;
        }
        img:hover {
            transform: scale(1.02);
        }
        .list-item {
            position: relative;
            padding-left: 1.5rem;
        }
        .list-item:before {
            content: "";
            position: absolute;
            left: 0;
            top: 0.6em;
            width: 0.5rem;
            height: 0.5rem;
            border-radius: 50%;
            background: #667eea;
        }
        .highlight-box {
            position: relative;
            background-color: #f8fafc;
            border-left: 4px solid #667eea;
        }
        .animate-float {
            animation: float 6s ease-in-out infinite;
        }
        @keyframes float {
            0% { transform: translateY(0px); }
            50% { transform: translateY(-15px); }
            100% { transform: translateY(0px); }
        }
    </style>
</head>
<body class="bg-gray-50">
    <!-- Hero Section -->
    <section class="hero-gradient text-white py-20 px-4 sm:px-6 lg:px-8">
        <div class="max-w-5xl mx-auto">
            <div class="flex flex-col md:flex-row items-center">
                <div class="md:w-1/2 mb-10 md:mb-0">
                    <h1 class="text-4xl md:text-5xl font-bold leading-tight mb-6">延时队列技术详解</h1>
                    <p class="text-xl text-blue-100 mb-8">高效管理异步任务，掌控时间维度</p>
                    <p class="text-blue-100 mb-8">在现代分布式系统中，延时队列是处理定时任务、超时控制和消息重试的核心组件。它通过引入时间维度，为系统设计提供了更大的灵活性。</p>
                    <div class="flex flex-wrap gap-4">
                        <a href="#intro" class="bg-white text-indigo-600 px-6 py-3 rounded-full font-medium hover:bg-indigo-50 transition duration-300">
                            <i class="fas fa-book-open mr-2"></i>了解详情
                        </a>
                        <a href="#applications" class="border border-white text-white px-6 py-3 rounded-full font-medium hover:bg-white hover:text-indigo-600 transition duration-300">
                            <i class="fas fa-lightbulb mr-2"></i>应用场景
                        </a>
                    </div>
                </div>
                <div class="md:w-1/2 flex justify-center">
                    <div class="relative w-full max-w-md">
                        <div class="absolute -top-10 -left-10 w-32 h-32 bg-purple-300 rounded-full mix-blend-multiply filter blur-xl opacity-70 animate-pulse"></div>
                        <div class="absolute -bottom-10 -right-10 w-32 h-32 bg-blue-300 rounded-full mix-blend-multiply filter blur-xl opacity-70 animate-pulse"></div>
                        <div class="relative animate-float">
                            <img src="https://cdn.nlark.com/yuque/0/2024/png/21449790/1721182671857-bbe8c17a-fbec-4902-b734-b6df69160fcd.png" alt="延时队列示意图" class="w-full h-auto">
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Main Content -->
    <div class="max-w-5xl mx-auto px-4 sm:px-6 lg:px-8 py-16">
        <!-- Introduction Section -->
        <section id="intro" class="mb-20">
            <div class="flex items-center mb-10">
                <div class="h-px bg-gray-300 flex-1"></div>
                <h2 class="text-3xl font-bold px-6">
                    <span class="text-indigo-600 mr-2"><i class="fas fa-question-circle"></i></span>
                    什么是延时队列？
                </h2>
                <div class="h-px bg-gray-300 flex-1"></div>
            </div>
            
            <div class="grid md:grid-cols-2 gap-10 mb-12">
                <div>
                    <p class="text-lg text-gray-700 mb-6">随着互联网应用的不断发展，我们面对的用户需求和业务场景也愈加复杂。在这种背景下，如何有效地管理和调度系统中的各种任务，成为了一个重要的挑战。</p>
                    <p class="text-lg text-gray-700 mb-6">比如，如何在用户下单后的一段时间内发送确认邮件，如何在用户未支付订单达到一定时间后自动取消订单，如何在系统出现故障时延迟重试任务，等等。这些需求都需要我们在一定的时间延迟后再执行某些操作，而不是立即进行处理。</p>
                    <p class="text-lg text-gray-700">这时候，延时队列就派上了用场。延时队列是一种特殊的消息队列，它允许我们将消息发送到队列后，设定一个延迟时间，只有在这个延迟时间过后，消息才会被处理。这样，我们就可以灵活地控制任务的执行时间，从而实现很多复杂的业务逻辑。</p>
                </div>
                <div class="bg-white rounded-xl shadow-md p-6 self-start card-hover">
                    <h3 class="text-xl font-semibold mb-4 text-indigo-600">核心特点</h3>
                    <ul class="space-y-3">
                        <li class="list-item">消息在队列中存储一段时间后再消费</li>
                        <li class="list-item">没有直接的消费者</li>
                        <li class="list-item">消息有超时时间(TTL)</li>
                        <li class="list-item">过期消息会变成死信</li>
                        <li class="list-item">死信消息会转到死信队列处理</li>
                    </ul>
                </div>
            </div>
            
            <img src="https://cdn.nlark.com/yuque/0/2024/png/21449790/1721182748958-57ff04fd-0719-4539-a35d-a1c4cffc1fe1.png" alt="延时队列与普通队列对比" class="w-full mb-10">
            
            <div class="grid md:grid-cols-2 gap-10">
                <div class="highlight-box p-6 rounded-lg">
                    <h3 class="text-xl font-semibold mb-4 text-indigo-600">普通队列</h3>
                    <p class="text-gray-700">消息一旦到队列，消费者马上就消费了。</p>
                </div>
                <div class="highlight-box p-6 rounded-lg">
                    <h3 class="text-xl font-semibold mb-4 text-indigo-600">延时队列</h3>
                    <p class="text-gray-700">消息在队列中储存一段时间后再消费。它是怎么做到的？延时队列没有消费者，延时队列有TTL，基于这两个条件来是实现的延时队列。</p>
                </div>
            </div>
        </section>

        <!-- Definition Section -->
        <section class="mb-20">
            <div class="flex items-center mb-10">
                <div class="h-px bg-gray-300 flex-1"></div>
                <h2 class="text-3xl font-bold px-6">
                    <span class="text-indigo-600 mr-2"><i class="fas fa-book"></i></span>
                    延时队列的定义与特性
                </h2>
                <div class="h-px bg-gray-300 flex-1"></div>
            </div>
            
            <div class="bg-white rounded-xl shadow-md p-8 mb-10 card-hover">
                <p class="text-lg text-gray-700 mb-6">延时队列是一种特殊的消息队列，它允许消息在被发送后经过一个预定的延迟时间才被消费者处理。与传统消息队列不同，延时队列通过引入时间维度，使得消息的处理时机得以灵活控制。这种机制适用于多种场景，尤其是在需要延迟任务执行的情况下，例如定时通知、超时订单处理等。</p>
                
                <div class="grid md:grid-cols-2 gap-6 mt-8">
                    <div>
                        <h3 class="text-xl font-semibold mb-4 text-indigo-600">基本特性</h3>
                        <ul class="space-y-3">
                            <li class="list-item"><span class="font-medium">延迟处理：</span>消息在进入延时队列后，需等待指定时间才能被消费</li>
                            <li class="list-item"><span class="font-medium">时间敏感性：</span>能够满足时间敏感的业务需求</li>
                            <li class="list-item"><span class="font-medium">灵活性：</span>支持多种延迟时间配置</li>
                            <li class="list-item"><span class="font-medium">消息调度：</span>具备消息调度功能，定期检查到期消息</li>
                        </ul>
                    </div>
                    <div>
                        <h3 class="text-xl font-semibold mb-4 text-indigo-600">与普通队列区别</h3>
                        <ul class="space-y-3">
                            <li class="list-item"><span class="font-medium">处理时机：</span>普通队列即时消费，延时队列延迟消费</li>
                            <li class="list-item"><span class="font-medium">业务逻辑：</span>延时队列引入时间控制，支持复杂业务场景</li>
                            <li class="list-item"><span class="font-medium">实现复杂度：</span>延时队列实现更复杂但灵活性更高</li>
                        </ul>
                    </div>
                </div>
            </div>
        </section>

        <!-- Principle Section -->
        <section class="mb-20">
            <div class="flex items-center mb-10">
                <div class="h-px bg-gray-300 flex-1"></div>
                <h2 class="text-3xl font-bold px-6">
                    <span class="text-indigo-600 mr-2"><i class="fas fa-cogs"></i></span>
                    延时队列的原理
                </h2>
                <div class="h-px bg-gray-300 flex-1"></div>
            </div>
            
            <div class="mb-10">
                <img src="https://cdn.nlark.com/yuque/0/2024/png/21449790/1721182793605-5dd792c0-cb2f-454a-8560-d000fda865df.png" alt="延时队列原理图" class="w-full">
            </div>
            
            <div class="grid md:grid-cols-2 gap-10">
                <div>
                    <div class="bg-white rounded-xl shadow-md p-6 mb-6 card-hover">
                        <h3 class="text-xl font-semibold mb-4 text-indigo-600">消息存储</h3>
                        <ul class="space-y-3">
                            <li class="list-item"><span class="font-medium">消息入队：</span>记录消息内容、入队时间和延迟时间</li>
                            <li class="list-item"><span class="font-medium">数据结构：</span>常用优先级队列或有序列表管理消息</li>
                        </ul>
                    </div>
                    
                    <div class="bg-white rounded-xl shadow-md p-6 mb-6 card-hover">
                        <h3 class="text-xl font-semibold mb-4 text-indigo-600">时间调度</h3>
                        <ul class="space-y-3">
                            <li class="list-item"><span class="font-medium">调度机制：</span>定时检查消息到期状态</li>
                            <li class="list-item"><span class="font-medium">延时计算：</span>计算当前时间与消息到期时间</li>
                        </ul>
                    </div>
                </div>
                
                <div>
                    <div class="bg-white rounded-xl shadow-md p-6 mb-6 card-hover">
                        <h3 class="text-xl font-semibold mb-4 text-indigo-600">消息处理</h3>
                        <ul class="space-y-3">
                            <li class="list-item"><span class="font-medium">消息出队：</span>到期消息转移到正常队列</li>
                            <li class="list-item"><span class="font-medium">消费者处理：</span>消费者从普通队列获取消息</li>
                        </ul>
                    </div>
                    
                    <div class="bg-white rounded-xl shadow-md p-6 mb-6 card-hover">
                        <h3 class="text-xl font-semibold mb-4 text-indigo-600">失败处理</h3>
                        <ul class="space-y-3">
                            <li class="list-item"><span class="font-medium">重试机制：</span>失败消息重新入队并设置新延迟时间</li>
                            <li class="list-item"><span class="font-medium">死信队列：</span>多次重试失败后转移到死信队列</li>
                        </ul>
                    </div>
                </div>
            </div>
        </section>

        <!-- Implementation Section -->
        <section class="mb-20">
            <div class="flex items-center mb-10">
                <div class="h-px bg-gray-300 flex-1"></div>
                <h2 class="text-3xl font-bold px-6">
                    <span class="text-indigo-600 mr-2"><i class="fas fa-code"></i></span>
                    延时队列的实现方式
                </h2>
                <div class="h-px bg-gray-300 flex-1"></div>
            </div>
            
            <div class="grid md:grid-cols-2 gap-8 mb-12">
                <div class="bg-white rounded-xl shadow-md p-6 card-hover">
                    <div class="flex items-center mb-4">
                        <div class="feature-icon rounded-full flex items-center justify-center text-white mr-4">
                            <i class="fas fa-memory text-2xl"></i>
                        </div>
                        <h3 class="text-xl font-semibold text-indigo-600">基于内存的实现</h3>
                    </div>
                    <ul class="space-y-2">
                        <li class="list-item">Java的<code class="bg-gray-100 px-2 py-1 rounded">DelayQueue</code></li>
                        <li class="list-item">基于优先级队列的延时队列</li>
                        <li class="list-item">适合低延迟、短生命周期的任务</li>
                        <li class="list-item">适合单节点应用</li>
                    </ul>
                </div>
                
                <div class="bg-white rounded-xl shadow-md p-6 card-hover">
                    <div class="flex items-center mb-4">
                        <div class="feature-icon rounded-full flex items-center justify-center text-white mr-4">
                            <i class="fas fa-server text-2xl"></i>
                        </div>
                        <h3 class="text-xl font-semibold text-indigo-600">基于消息中间件</h3>
                    </div>
                    <ul class="space-y-2">
                        <li class="list-item">RabbitMQ的TTL特性</li>
                        <li class="list-item">RabbitMQ延迟队列插件</li>
                        <li class="list-item">Kafka的定时消息策略</li>
                        <li class="list-item">高扩展性，适合分布式环境</li>
                    </ul>
                </div>
                
                <div class="bg-white rounded-xl shadow-md p-6 card-hover">
                    <div class="flex items-center mb-4">
                        <div class="feature-icon rounded-full flex items-center justify-center text-white mr-4">
                            <i class="fas fa-database text-2xl"></i>
                        </div>
                        <h3 class="text-xl font-semibold text-indigo-600">基于数据库的实现</h3>
                    </div>
                    <ul class="space-y-2">
                        <li class="list-item">轮询检查消息表</li>
                        <li class="list-item">记录消息内容、到期时间和状态</li>
                        <li class="list-item">持久化存储，可恢复性强</li>
                        <li class="list-item">可能引入性能瓶颈</li>
                    </ul>
                </div>
                
                <div class="bg-white rounded-xl shadow-md p-6 card-hover">
                    <div class="flex items-center mb-4">
                        <div class="feature-icon rounded-full flex items-center justify-center text-white mr-4">
                            <i class="fas fa-bolt text-2xl"></i>
                        </div>
                        <h3 class="text-xl font-semibold text-indigo-600">基于Redis的实现</h3>
                    </div>
                    <ul class="space-y-2">
                        <li class="list-item">利用有序集合(Sorted Set)</li>
                        <li class="list-item">时间戳加延迟时间作为排序分数</li>
                        <li class="list-item">高效、简单，支持高并发</li>
                        <li class="list-item">适合实时性要求高的场景</li>
                    </ul>
                </div>
            </div>
            
            <div class="bg-white rounded-xl shadow-md p-6 mb-10 card-hover">
                <h3 class="text-xl font-semibold mb-4 text-indigo-600">RabbitMQ实现延时队列的三种方式</h3>
                <div class="grid md:grid-cols-3 gap-4">
                    <div class="border border-gray-200 rounded-lg p-4 hover:border-indigo-300 transition">
                        <h4 class="font-medium mb-2">1. 消息TTL</h4>
                        <p class="text-sm text-gray-600">给每个消息设置超时时间</p>
                    </div>
                    <div class="border border-gray-200 rounded-lg p-4 hover:border-indigo-300 transition">
                        <h4 class="font-medium mb-2">2. 队列TTL</h4>
                        <p class="text-sm text-gray-600">给队列设置超时时间</p>
                    </div>
                    <div class="border border-gray-200 rounded-lg p-4 hover:border-indigo-300 transition">
                        <h4 class="font-medium mb-2">3. 延时插件</h4>
                        <p class="text-sm text-gray-600">发送消息时设置超时间(推荐)</p>
                    </div>
                </div>
            </div>
            
            <div class="grid md:grid-cols-2 gap-8">
                <div>
                    <img src="https://cdn.nlark.com/yuque/0/2022/png/21449790/1652524845705-66aacee3-9023-4dfe-bb77-ec842ec5d9df.png" alt="RabbitMQ延时队列实现" class="w-full">
                </div>
                <div>
                    <img src="https://cdn.nlark.com/yuque/0/2022/png/21449790/1670053424917-d19fec92-f9f7-4f96-9e1a-5052d22edfc0.png" alt="RabbitMQ延时插件实现" class="w-full">
                </div>
            </div>
        </section>

        <!-- Applications Section -->
        <section id="applications" class="mb-20">
            <div class="flex items-center mb-10">
                <div class="h-px bg-gray-300 flex-1"></div>
                <h2 class="text-3xl font-bold px-6">
                    <span class="text-indigo-600 mr-2"><i class="fas fa-lightbulb"></i></span>
                    延时队列的应用场景
                </h2>
                <div class="h-px bg-gray-300 flex-1"></div>
            </div>
            
            <div class="grid md:grid-cols-2 gap-8">
                <div class="bg-white rounded-xl shadow-md p-6 card-hover">
                    <div class="flex items-center mb-4">
                        <div class="w-10 h-10 bg-indigo-100 rounded-full flex items-center justify-center text-indigo-600 mr-4">
                            <i class="fas fa-clock"></i>
                        </div>
                        <h3 class="text-xl font-semibold text-indigo-600">定时任务调度</h3>
                    </div>
                    <p class="text-gray-700">定期生成报表、清理过期数据、发送定时通知等。通过延时队列可以确保这些任务在特定时间点执行，无需复杂调度器。</p>
                </div>
                
                <div class="bg-white rounded-xl shadow-md p-6 card-hover">
                    <div class="flex items-center mb-4">
                        <div class="w-10 h-10 bg-indigo-100 rounded-full flex items-center justify-center text-indigo-600 mr-4">
                            <i class="fas fa-shopping-cart"></i>
                        </div>
                        <h3 class="text-xl font-semibold text-indigo-600">超时订单处理</h3>
                    </div>
                    <p class="text-gray-700">电商平台中，用户下单后设定支付时间限制。如果超时未支付，订单自动取消。延时队列可以精确控制这一过程。</p>
                </div>
                
                <div class="bg-white rounded-xl shadow-md p-6 card-hover">
                    <div class="flex items-center mb-4">
                        <div class="w-10 h-10 bg-indigo-100 rounded-full flex items-center justify-center text-indigo-600 mr-4">
                            <i class="fas fa-sync-alt"></i>
                        </div>
                        <h3 class="text-xl font-semibold text-indigo-600">消息重试机制</h3>
                    </div>
                    <p class="text-gray-700">分布式系统中，处理失败的消息可以通过延时队列重新入队，并设置适当延迟，避免过于频繁地重试。</p>
                </div>
                
                <div class="bg-white rounded-xl shadow-md p-6 card-hover">
                    <div class="flex items-center mb-4">
                        <div class="w-10 h-10 bg-indigo-100 rounded-full flex items-center justify-center text-indigo-600 mr-4">
                            <i class="fas fa-box-open"></i>
                        </div>
                        <h3 class="text-xl font-semibold text-indigo-600">订单处理</h3>
                    </div>
                    <p class="text-gray-700">电商平台中的预售订单，可以在特定时间后处理。延时队列确保在预售结束后执行库存和支付处理。</p>
                </div>
                
                <div class="bg-white rounded-xl shadow-md p-6 card-hover">
                    <div class="flex items-center mb-4">
                        <div class="w-10 h-10 bg-indigo-100 rounded-full flex items-center justify-center text-indigo-600 mr-4">
                            <i class="fas fa-chart-line"></i>
                        </div>
                        <h3 class="text-xl font-semibold text-indigo-600">实时数据处理</h3>
                    </div>
                    <p class="text-gray-700">对实时数据流进行延迟处理，如数据清洗或格式转换。延时队列可以控制数据处理的时间窗口，保证系统稳定性。</p>
                </div>
                
                <div class="bg-white rounded-xl shadow-md p-6 card-hover">
                    <div class="flex items-center mb-4">
                        <div class="w-10 h-10 bg-indigo-100 rounded-full flex items-center justify-center text-indigo-600 mr-4">
                            <i class="fas fa-calendar-check"></i>
                        </div>
                        <h3 class="text-xl font-semibold text-indigo-600">预约系统</h3>
                    </div>
                    <p class="text-gray-700">医院挂号系统中，预约后需要在指定时间提醒用户。延时队列可以在预约时间前触发提醒通知。</p>
                </div>
            </div>
        </section>

        <!-- Architecture Section -->
        <section class="mb-20">
            <div class="flex items-center mb-10">
                <div class="h-px bg-gray-300 flex-1"></div>
                <h2 class="text-3xl font-bold px-6">
                    <span class="text-indigo-600 mr-2"><i class="fas fa-project-diagram"></i></span>
                    RabbitMQ延时插件架构设计
                </h2>
                <div class="h-px bg-gray-300 flex-1"></div>
            </div>
            
            <div class="bg-white rounded-xl shadow-md p-8 mb-10 card-hover">
                <div class="mb-6">
                    <h3 class="text-xl font-semibold mb-4 text-indigo-600">插件结构</h3>
                    <div class="mermaid">
                        graph LR
                            A[Producer] --> B[延时交换机]
                            B --> C[延时队列]
                            C --> D{调度器}
                            D -->|到期消息| E[目标队列]
                            E --> F[Consumer]
                    </div>
                </div>
                
                <div class="grid md:grid-cols-2 gap-8">
                    <div>
                        <h3 class="text-xl font-semibold mb-4 text-indigo-600">核心模块</h3>
                        <ul class="space-y-3">
                            <li class="list-item"><span class="font-medium">消息存储：</span>专门存储延时消息的队列</li>
                            <li class="list-item"><span class="font-medium">调度机制：</span>定时检查消息到期状态</li>
                            <li class="list-item"><span class="font-medium">API接口：</span>与RabbitMQ其他组件交互</li>
                        </ul>
                    </div>
                    
                    <div>
                        <h3 class="text-xl font-semibold mb-4 text-indigo-600">消息生命周期</h3>
                        <ul class="space-y-3">
                            <li class="list-item"><span class="font-medium">入队：</span>记录当前时间和延迟时间</li>
                            <li class="list-item"><span class="font-medium">转发：</span>到期后转移到目标队列</li>
                            <li class="list-item"><span class="font-medium">处理：</span>消费者从目标队列获取消息</li>
                        </ul>
                    </div>
                </div>
            </div>
            
            <div class="grid md:grid-cols-2 gap-8">
                <div class="bg-white rounded-xl shadow-md p-6 card-hover">
                    <h3 class="text-xl font-semibold mb-4 text-indigo-600">可靠性与一致性</h3>
                    <ul class="space-y-3">
                        <li class="list-item"><span class="font-medium">持久化：</span>消息存储在磁盘上，防止丢失</li>
                        <li class="list-item"><span class="font-medium">事务支持：</span>与RabbitMQ事务特性兼容</li>
                        <li class="list-item"><span class="font-medium">原子性操作：</span>确保消息不被重复处理</li>
                    </ul>
                </div>
                
                <div class="bg-white rounded-xl shadow-md p-6 card-hover">
                    <h3 class="text-xl font-semibold mb-4 text-indigo-600">性能优化</h3>
                    <ul class="space-y-3">
                        <li class="list-item"><span class="font-medium">高效调度：</span>异步非阻塞方式处理高并发</li>
                        <li class="list-item"><span class="font-medium">负载均衡：</span>支持水平扩展，多实例处理</li>
                        <li class="list-item"><span class="font-medium">监控告警：</span>实时监控消息状态和处理情况</li>
                    </ul>
                </div>
            </div>
        </section>
    </div>

    <!-- Footer -->
    <footer class="bg-gray-900 text-white py-12">
        <div class="max-w-5xl mx-auto px-4 sm:px-6 lg:px-8">
            <div class="flex flex-col items-center">
                <div class="text-2xl font-bold mb-4">技术小馆</div>
                <a href="http://www.yuque.com/jtostring" class="text-blue-300 hover:text-white transition duration-300">
                    <i class="fas fa-link mr-2"></i>http://www.yuque.com/jtostring
                </a>
                <div class="mt-8 text-gray-400 text-sm">
                    &copy; 2024 技术小馆. All rights reserved.
                </div>
            </div>
        </div>
    </footer>

    <script>
        mermaid.initialize({
            startOnLoad: true,
            theme: 'default',
            flowchart: {
                useMaxWidth: true,
                htmlLabels: true,
                curve: 'basis'
            }
        });
    </script>
</body>
</html>
```